﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Arkanoid
{
    class Upgrades
    {
        public Texture2D textura;
        public Vector2 posicao;

        GraphicsDeviceManager graphics;
        public bool ativo = true;
        public int upgrade;

        public Rectangle retangulo;

        public Upgrades(GraphicsDeviceManager graphics, Texture2D textura, Vector2 posicao, int upgrade)
        {
            this.textura = textura;
            this.posicao = posicao;
            this.graphics = graphics;
            this.upgrade = upgrade;
        }

        public void Update()
        {
            posicao.Y += 2;
            retangulo = new Rectangle((int)posicao.X + 3, (int)posicao.Y + 5, textura.Width - 7, textura.Height - 10);

            if (posicao.Y > graphics.PreferredBackBufferHeight)
            {
                ativo = false;
            }
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            if (ativo)
            {
                spriteBatch.Draw(textura, posicao, Color.White);
            }  
        }
    }
}
